package com.atguigu.team.junit;

import org.junit.Test;

import com.atguigu.team.domain.Employee;
import com.atguigu.team.service.NameListService;
import com.atguigu.team.service.TeamException;

/**
 * 
* @Description 对NameListSercece 进行测试
* @author yihu Email:1057202547@qq.com
* @version
* @date 2020年11月20日上午11:39:38
*
 */
public class NameListServiceTest {
	
	@Test
	public void testGetAllEmployees() {
		NameListService service = new NameListService();
		
		Employee[] employees = service.getAllEmployees();
		
		for (int i = 0; i < employees.length; i++) {
			System.out.println(employees[i]);
		}
				
	}
	
	
	@Test
	public void testGetEmployee() {
		
		NameListService service = new NameListService();
		int id = 10;
		try {
			Employee e1 = service.getEmployee(id);
			System.out.print(e1);
		} catch (TeamException e) {
			System.out.println(e.getMessage());
		} 

	} 
	
	
}
